//
//  CreateOrderViewCell.m
//  EastMarket
//
//  Created by 李鹏程 on 16/11/21.
//  Copyright © 2016年 guoguo. All rights reserved.
//

#import "CreateOrderViewCell.h"

@implementation CreateOrderViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        CGFloat spacing = 8.0f;
        CGFloat border = 1.0f;
        CGFloat lblHeight = 22.0f;
        
        // 产品icon
        _imgProductIcon = [[UIImageView alloc] initWithFrame:CGRectMake(spacing , spacing, 66 - 2 * spacing, 66 - 2 * spacing)];
        _imgProductIcon.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_imgProductIcon];

        _lblProductName = [[UILabel alloc] initWithFrame:CGRectMake(_imgProductIcon.frame.origin.x + _imgProductIcon.frame.size.width + spacing, spacing, SCREEN_WIDTH - 2 * spacing, lblHeight)];
        _lblProductName.font = [UIFont systemFontOfSize:16];
        _lblProductName.textColor = EastMarket_darkBlackFontColor;
        [self.contentView addSubview:_lblProductName];
        
        _lblProductPrice = [[UILabel alloc] initWithFrame:CGRectMake(_lblProductName.frame.origin.x, _lblProductName.frame.origin.y + _lblProductName.frame.size.height + border, (SCREEN_WIDTH- 2 * spacing - border) / 2, lblHeight)];
        _lblProductPrice.font = [UIFont systemFontOfSize:14];
        _lblProductPrice.textColor = EastMarket_MainToneColor;
        [self.contentView addSubview:_lblProductPrice];
        
        _lblProductNum = [[UILabel alloc] initWithFrame:CGRectMake(_lblProductPrice.frame.origin.x + _lblProductPrice.frame.size.width + border, _lblProductPrice.frame.origin.y, (SCREEN_WIDTH - 2 * spacing - border) / 2, lblHeight)];
        _lblProductNum.font = [UIFont systemFontOfSize:16];
        _lblProductNum.textColor = EastMarket_darkGreyFontColor;
        _lblProductNum.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_lblProductNum];
    }
    return self;
}


@end
